using System;
using System.Collections.Generic;
using System.Text;
using DotExe.Core.Web;
using DotExe.Core.DataSources;
using DotExe.Core.Uml.Behaviors.CommonBehaviors.Communications;
using DotExe.Core.Controls;

namespace WebSMSApp.Forms
{
    public partial class MainForm : ClientApplication
    {
        AnswerForm answer = new AnswerForm();
        EmployeeListForm agents = new EmployeeListForm();
        GroupListForm groups = new GroupListForm();
        BulkSendForm bulk = new BulkSendForm();
        BulkGroupForm bulkGroup = new BulkGroupForm();
        TemplateListForm templates = new TemplateListForm();
        SignatureListForm signatures = new SignatureListForm();

        List<Data> listAll = new List<Data>();
        List<Data> listMy = new List<Data>();

        public MainForm()
            : base()
        {
            this.Loaded += new System.EventHandler(MainForm_Load);
            this.Started += new System.EventHandler(MainForm_Started);
        }

        //occures after datasources and trigger configuration loads
        protected void MainForm_Load(object sender, EventArgs e)
        {
            InitializeComponent();

            //initialize custom data sources and triggers
        }

        //ocurres on everytime form starts
        protected void MainForm_Started(object sender, EventArgs e)
        {
            listAll.Add(new Data { Question = "Da li sam ja normalan?", DateReceived = DateTime.Now, FromNumber = "0600130602", Answer = string.Empty });
            listAll.Add(new Data { Question = "Da li treba da pijem?", DateReceived = DateTime.Now, FromNumber = "0600130602", Answer = string.Empty });
            listAll.Add(new Data { Question = "Da li cu se udati?", DateReceived = DateTime.Now, FromNumber = "0600130602", Answer = string.Empty });

            dsAllMessages.Source = listAll;
            dsAllMessages.Bind();
        }

        protected virtual void gvAllMessageClick(object sender, EventArgs e)
        {

        }
        protected virtual void btnRefreshClick(object sender, EventArgs e)
        {

        }
        protected virtual void cmAllUnansweredMessagesAnswerClick(object sender, EventArgs e)
        {
            AnswerForm answer = new AnswerForm();
            answer.StartModal();
        }
        protected virtual void cmMyMessagesPreviewClick(object sender, EventArgs e)
        {

        }
        protected virtual void cmAllAnsweredMessagesPreviewClick(object sender, EventArgs e)
        {

        }

        protected virtual void btnBulkGroupsClick(object sender, EventArgs e)
        {
            bulkGroup.StartModal();
        }
        protected virtual void btnBulkTemplatesClick(object sender, EventArgs e)
        {
            templates.StartModal();
        }
        protected virtual void btnBulkSignaturesClick(object sender, EventArgs e)
        {
            signatures.StartModal();
        }
		protected virtual void btnAgentsSettingsClick(object sender, EventArgs e)
		{
            agents.StartModal();
		}
		protected virtual void btnGroupSettingsClick(object sender, EventArgs e)
		{
            groups.StartModal();
		}
        
        protected virtual void btnLogoutClick(object sender, EventArgs e)
        {

        }		

		protected virtual void btnBulkSendIndividualClick(object sender, EventArgs e)
		{
            bulk.StartModal();
		}

		protected virtual void btnBulkSendGroupClick(object sender, EventArgs e)
		{
            bulk.StartModal();
		}
    }
}